<?php
include './header.php';

// 查询总条数
$count = select_one('nnd_info', 'COUNT(*)')['0'];

// 获取页码
$current = (!empty($_GET['page']) &&  $_GET['page'] > 0) ? $_GET['page'] : 1;

// 每页显示条数
$limit = 5;

// 偏移量
$offset = ($current - 1) * $limit;

//显示分页样式的页码个数
$size = 5; 

$page = page($current, $count, $limit, $size, 'my-page');

// 查询资讯中心数据
$info = select_data('nnd_info', '*', "ORDER BY info_id DESC LIMIT $offset,$limit");

include './views/news_center.html';

include './footer.php';
